package com.beiding.workordersystem.common.standard;

public enum ResponseStatus {

    SUCCESS(200,"success"),NOT_FOUND(404, "not found"), ERROR(500, "isFalse"), FORBIDDEN(403, "forbidden"), UNAUTHORIZED(401, "unauthorized");
    private int status;
    private String msg;
    public int getStatus() {
        return status;
    }
    public String getMsg() {
        return msg;
    }

    ResponseStatus(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public ResponseStatus of(int status)  {
        switch (status) {
            case 200:
                return SUCCESS;
            case 500:
                return ERROR;
            case 403:
                return FORBIDDEN;
            case 401:
                return UNAUTHORIZED;
        }
        return null;
    }

}
